﻿CREATE TABLE [org].[Book] (
    [BookId]                      INT             NOT NULL,
    [BookCode]                    CHAR (3)        NOT NULL,
    [BookName]                    VARCHAR (50)    NOT NULL,
    [BookDescription]             NVARCHAR (1000) NULL,
    [BookReference]               VARCHAR (8)     NULL,
    [BookReferenceType]           VARCHAR (8)     NULL,
    [BookTrader]                  VARCHAR (100)   NULL,
    [BookPnLPackageId]            SMALLINT        NULL,
    [BookDoubleEntryBookCode]     CHAR (3)        NULL,
    [BookFlashPnlMinThresholdGBP] DECIMAL (18, 2) NULL,
    [BookFlashPnLMaxThresholdGBP] DECIMAL (18, 2) NULL,
    [BookFlashManualUpload]       BIT             NOT NULL,
    [BookFlashMurexUpload]        BIT             NOT NULL,
    [BookAdjustFutures]           BIT             NOT NULL,
    [BookStartDate]               DATE            NOT NULL,
    [BookEndDate]                 DATE            NULL,
    [IsLatest]                    BIT             NOT NULL,
    [IsActive]                    BIT             NOT NULL,
    [IsInternal]                  BIT             NOT NULL,
    PRIMARY KEY CLUSTERED ([BookId] ASC) WITH (ALLOW_PAGE_LOCKS = ON, ALLOW_ROW_LOCKS = ON, PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, STATISTICS_NORECOMPUTE = OFF)
);

